package cn.hoichun.news.Mapper;

import cn.hoichun.news.Domain.Rating;
import cn.hoichun.news.Domain.View;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;
import java.util.List;

/**
 * @author Hoichun
 */
@Mapper
public interface ScoreMapper {
    /**
     * @param userId    用户id
     * @param articleId 文章id
     * @return score 分数
     */
    View getScore(int userId, int articleId);

    /**
     * @param userId    用户id
     * @param articleId 文章id
     * @param interest  分数
     */
    void insertScore(int userId, int articleId, int interest, int quality, Date date);

    List<Rating> selectAllRatings();

    int selectUserNumber();

    List<Integer> selectAllUserId();

    List<Integer> selectAllArticleId();

    List<Integer> selectArticleByUserId(int userId);
}
